package faw.car.ccentersdk.prop;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * @Author zhuima
 */
public class HQAPIConfig implements Parcelable {

    private int status;

    private String servicePkg;
    private int userHandler;

    private boolean isSupport;
    private boolean isEnable;
    private int rank;
    private HQActionConfig setConfig;
    private HQActionConfig getConfig;
    private HQActionConfig callbackConfig;
    private HQActionConfig fetchConfig;
    private HQActionConfig checkConfig;
    private boolean isSupportCache;
    private boolean isForce;

    private String sourceType;
    private String sourceJson;

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(this.status);
        dest.writeString(this.servicePkg);
        dest.writeInt(this.userHandler);
        dest.writeByte(this.isSupport ? (byte) 1 : (byte) 0);
        dest.writeByte(this.isEnable ? (byte) 1 : (byte) 0);
        dest.writeInt(this.rank);
        dest.writeParcelable(this.setConfig, flags);
        dest.writeParcelable(this.getConfig, flags);
        dest.writeParcelable(this.callbackConfig, flags);
        dest.writeParcelable(this.fetchConfig, flags);
        dest.writeParcelable(this.checkConfig, flags);
        dest.writeByte(this.isSupportCache ? (byte) 1 : (byte) 0);
        dest.writeByte(this.isForce ? (byte) 1 : (byte) 0);
        dest.writeString(this.sourceType);
        dest.writeString(this.sourceJson);
    }

    public HQAPIConfig() {
    }

    protected HQAPIConfig(Parcel in) {
        this.status = in.readInt();
        this.servicePkg = in.readString();
        this.userHandler = in.readInt();
        this.isSupport = in.readByte() != 0;
        this.isEnable = in.readByte() != 0;
        this.rank = in.readInt();
        this.setConfig = in.readParcelable(HQActionConfig.class.getClassLoader());
        this.getConfig = in.readParcelable(HQActionConfig.class.getClassLoader());
        this.callbackConfig = in.readParcelable(HQActionConfig.class.getClassLoader());
        this.fetchConfig = in.readParcelable(HQActionConfig.class.getClassLoader());
        this.checkConfig = in.readParcelable(HQActionConfig.class.getClassLoader());
        this.isSupportCache = in.readByte() != 0;
        this.isForce = in.readByte() != 0;
        this.sourceType = in.readString();
        this.sourceJson = in.readString();
    }

    public static final Creator<HQAPIConfig> CREATOR = new Creator<HQAPIConfig>() {
        @Override
        public HQAPIConfig createFromParcel(Parcel source) {
            return new HQAPIConfig(source);
        }

        @Override
        public HQAPIConfig[] newArray(int size) {
            return new HQAPIConfig[size];
        }
    };

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getServicePkg() {
        return servicePkg;
    }

    public void setServicePkg(String servicePkg) {
        this.servicePkg = servicePkg;
    }

    public int getUserHandler() {
        return userHandler;
    }

    public void setUserHandler(int userHandler) {
        this.userHandler = userHandler;
    }

    public boolean isSupport() {
        return isSupport;
    }

    public void setSupport(boolean support) {
        isSupport = support;
    }

    public boolean isEnable() {
        return isEnable;
    }

    public void setEnable(boolean enable) {
        isEnable = enable;
    }

    public int getRank() {
        return rank;
    }

    public void setRank(int rank) {
        this.rank = rank;
    }

    public HQActionConfig getSetConfig() {
        return setConfig;
    }

    public void setSetConfig(HQActionConfig setConfig) {
        this.setConfig = setConfig;
    }

    public HQActionConfig getGetConfig() {
        return getConfig;
    }

    public void setGetConfig(HQActionConfig getConfig) {
        this.getConfig = getConfig;
    }

    public HQActionConfig getCallbackConfig() {
        return callbackConfig;
    }

    public void setCallbackConfig(HQActionConfig callbackConfig) {
        this.callbackConfig = callbackConfig;
    }

    public HQActionConfig getFetchConfig() {
        return fetchConfig;
    }

    public void setFetchConfig(HQActionConfig fetchConfig) {
        this.fetchConfig = fetchConfig;
    }

    public HQActionConfig getCheckConfig() {
        return checkConfig;
    }

    public void setCheckConfig(HQActionConfig checkConfig) {
        this.checkConfig = checkConfig;
    }

    public boolean isSupportCache() {
        return isSupportCache;
    }

    public void setSupportCache(boolean supportCache) {
        isSupportCache = supportCache;
    }

    public boolean isForce() {
        return isForce;
    }

    public void setForce(boolean force) {
        isForce = force;
    }

    public String getSourceType() {
        return sourceType;
    }

    public void setSourceType(String sourceType) {
        this.sourceType = sourceType;
    }

    public String getSourceJson() {
        return sourceJson;
    }

    public void setSourceJson(String sourceJson) {
        this.sourceJson = sourceJson;
    }
}
